<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="sidebar-collapse">
        <ul class="nav metismenu" id="side-menu">
            <li class="nav-header">
                <div class="dropdown profile-element">
                    <span class="h-50 w-50">
                        <img alt="image" class="img-circle" style="height: 50px;width: 50px;" src="https://ws2.sinaimg.cn/large/0069RVTdgy1fv044x9dh7j305k05kglh.jpg" />
                    </span>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear"> <span class="block m-t-xs"> </span> <span class="text-muted text-xs block">{{$curUser->name or ''}} <b class="caret"></b></span> </span> </a>
                    <ul class="dropdown-menu animated fadeInRight m-t-xs">
                        <li><a href="{{route('admin.user.profile')}}">个人资料</a></li>
                        <li class="divider"></li>
                        <li><a href="{{route('admin-logout')}}">Logout</a></li>
                    </ul>
                </div>
                <div class="logo-element">
                    IN+
                </div>
            </li>

            @if($menus)
                @foreach($menus as $m)
                    @if(!checkPermission($m->slug))
                        @continue
                    @endif
                    @php
                    $checkRoutes = explode('|',$m->url);
                    @endphp
                    <li  class="{{active_class(if_route_pattern($checkRoutes),'active','')}}" >
                        <a href="#"><i class="fa {{$m->icon}}"></i> <span class="nav-label">{{$m->name}}</span><span class="fa arrow"></span></a>
                        @if($m->allChild)
                        <ul class="nav nav-second-level collapse">
                            @foreach($m->allChild as $c)
                                @if(!checkPermission($c->slug))
                                    @continue
                                @endif
                            <li class="{{active_class(if_route_pattern($c->url),'active','')}}">
                                <a href="{{route($c->slug)}}"><i class="fa {{$c->icon}}"></i>{{$c->name}}</a>
                            </li>
                            @endforeach
                        </ul>
                        @endif
                    </li>
                @endforeach
            @endif


        </ul>

    </div>
</nav>